Optimal. Leaf size=140 \[ \frac {b^2 (d \tan (e+f x))^{1+n}}{d f (1+n)}+\frac {\left (a^2-b^2\right ) \, _2F_1\left (1,\frac {1+n}{2};\frac {3+n}{2};-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{1+n}}{d f (1+n)}+\frac {2 a b \, _2F_1\left (1,\frac {2+n}{2};\frac {4+n}{2};-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{2+n}}{d^2 f (2+n)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 140, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 4, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {3624, 3619,
3557, 371} \begin {gather*} \frac {\left (a^2-b^2\right ) (d \tan (e+f x))^{n+1} \, _2F_1\left (1,\frac {n+1}{2};\frac {n+3}{2};-\tan ^2(e+f x)\right )}{d f (n+1)}+\frac {2 a b (d \tan (e+f x))^{n+2} \, _2F_1\left (1,\frac {n+2}{2};\frac {n+4}{2};-\tan ^2(e+f x)\right )}{d^2 f (n+2)}+\frac {b^2 (d \tan (e+f x))^{n+1}}{d f (n+1)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 371
Rule 3557
Rule 3619
Rule 3624
Rubi steps
\begin {align*} \int (d \tan (e+f x))^n (a+b \tan (e+f x))^2 \, dx &=\frac {b^2 (d \tan (e+f x))^{1+n}}{d f (1+n)}+\int (d \tan (e+f x))^n \left (a^2-b^2+2 a b \tan (e+f x)\right ) \, dx\\ &=\frac {b^2 (d \tan (e+f x))^{1+n}}{d f (1+n)}+\left (a^2-b^2\right ) \int (d \tan (e+f x))^n \, dx+\frac {(2 a b) \int (d \tan (e+f x))^{1+n} \, dx}{d}\\ &=\frac {b^2 (d \tan (e+f x))^{1+n}}{d f (1+n)}+\frac {(2 a b) \text {Subst}\left (\int \frac {x^{1+n}}{d^2+x^2} \, dx,x,d \tan (e+f x)\right )}{f}+\frac {\left (\left (a^2-b^2\right ) d\right ) \text {Subst}\left (\int \frac {x^n}{d^2+x^2} \, dx,x,d \tan (e+f x)\right )}{f}\\ &=\frac {b^2 (d \tan (e+f x))^{1+n}}{d f (1+n)}+\frac {\left (a^2-b^2\right ) \, _2F_1\left (1,\frac {1+n}{2};\frac {3+n}{2};-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{1+n}}{d f (1+n)}+\frac {2 a b \, _2F_1\left (1,\frac {2+n}{2};\frac {4+n}{2};-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{2+n}}{d^2 f (2+n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.42, size = 116, normalized size = 0.83 \begin {gather*} \frac {\tan (e+f x) (d \tan (e+f x))^n \left (\left (a^2-b^2\right ) (2+n) \, _2F_1\left (1,\frac {1+n}{2};\frac {3+n}{2};-\tan ^2(e+f x)\right )+b \left (b (2+n)+2 a (1+n) \, _2F_1\left (1,\frac {2+n}{2};\frac {4+n}{2};-\tan ^2(e+f x)\right ) \tan (e+f x)\right )\right )}{f (1+n) (2+n)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.37, size = 0, normalized size = 0.00 \[\int \left (d \tan \left (f x +e \right )\right )^{n} \left (a +b \tan \left (f x +e \right )\right )^{2}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (d \tan {\left (e + f x \right )}\right )^{n} \left (a + b \tan {\left (e + f x \right )}\right )^{2}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\left (d\,\mathrm {tan}\left (e+f\,x\right )\right )}^n\,{\left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )}^2 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________